package com.zhouhailin.aop;

import com.zhouhailin.aop.service.impl.AopDemoServiceImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 主方法
 *
 * @Author zhouhailin
 * @date 2023/1/31 16:46
 */
public class Aop {
    public static void main(String[] args) {

        // create and configure beans
        ApplicationContext context = new ClassPathXmlApplicationContext("aspects.xml");

        AopDemoServiceImpl service = context.getBean("demoService", AopDemoServiceImpl.class);

        service.doMethod1();
        service.doMethod2();
        try {
            service.doMethod3();
        } catch (Exception e) {
            //e.printStackTrace();
        }
    }
}
